package org.tong.web2.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author
 * @date 2022-10-08 13:48
 */
@RestController
@RequestMapping("/web2")
public class Web2IndexController {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @GetMapping("/")
    public String index() {
        List<Map<String, Object>> tables = jdbcTemplate.queryForList("show tables");
        System.out.println(tables);
        return "welcome to web2";
    }
}
